/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Matricula.Capa_Presentacion;
import Matricula.Capa_Negocios.cntMatricula;
import Rada.Html.Ahref;
import Rada.Html.Button;
import Rada.Html.Div;
import Rada.Html.Label;
import Rada.Html.Table;
/**
 *
 * @author Miguel
 */
public class frmMatricula {
    public frmMatricula(){

    }
    public String show(){
        String html="";
        
        Table tableMain = new Table();
        Div divCourse = new Div("divCourse");
        Div divGroup = new Div("divGroup");
        Div divChoose = new Div("divCourseSelected");
        Div divSchedule = new Div("divSchedule");

        tableMain.addRow();
        tableMain.width = "800px";
        tableMain.TrCurrent.height= "300px";
        tableMain.add(divCourse);
        tableMain.add(divGroup);
        
        tableMain.addRow();
        tableMain.addColSpan(divChoose,2);
        tableMain.addRow();
        tableMain.addColSpan(divSchedule,2);

        divCourse.add(new Label("Cursos"));
        divGroup.add(new Label("Grupos"));
        divChoose.add(new Label("Cursos Elegidos"));
        divSchedule.add(new Label("Horario"));

        Div divMain = new Div();
        divMain.ID="divMatricula";
        
        divMain.add(tableMain);

        //Cursos
        Table tableCursos = new Table();
        divCourse.add(tableCursos);

        cntMatricula cnt = new cntMatricula();
        //cntPeriodo periodo = new cntPeriodo();
        String[][] data = cnt.mostrarCursos();
        if (data!=null){
            for (int i=0;i<data.length;i++){
                tableCursos.addRow();
                for (int j=0;j<data[i].length;j++){
                    tableCursos.add(new Label(data[i][j]));
                }
                tableCursos.add(new Button(data[i][0],"Elegir","showCursosMatricula(this)"));
            }
        }
        html+= divMain.show();
        return html;
    }
    public void escogerCursos(){
        
    }

    public void escogerGrupos(){

    }

    /**
     *
     * @param cursos
     */
    public boolean verificarCreditos(int cursos){
            return false;
    }
}